A visual editor is a computer-based application that allows users to construct documents and user interfaces of computer programs by placing objects, such as text and buttons, onto electronic canvases that represent pages and windows. The objects that are placed onto a canvas, and their layout on a canvas, may be represented using either of two standard formats: the markup language (ML) format and the coordinate format. There is no direct correspondence between the statements of these two formats.
The ML format (also called the "tag format" herein) represents objects on an electronic canvas as an ordered (i.e., linear, sequential) sequence of statements that contains both definitions of the objects themselves (for example, the text of a textual object), and statements that determine how the objects are to be laid out. ML statements that determine layout are typically expressed in units that are associated with the documents, for example: page, paragraph, line, etc. To illustrate, consider two lines as they may appear on a page:
This is the first line. PA1 This is the second line. PA1 This is the first line.&lt;BR&gt;This is the second line.
In a document conforming to the ML format, these two lines are stored as follows:
The &lt;BR&gt; statement indicates that there is a linebreak between the text preceding it and the text following it. There are different implementations of the ML format, two of which being the Standard General Markup Language (SGML), and another being the Hypertext Markup Language (HTML).
The coordinate format records for each object: (1) the definition of the object; and (2) the {x,y} coordinate position of the object (the position of the object in the electronic canvas). In a document conforming to the coordinate format, the two example lines shown above may be stored as follows (assume that the height of a row is 10 units and the y-coordinate runs from top to bottom):
Text Object 2: text="This is the second line", coordinates={0,20} PA0 Text Object 1: text="This is the first line", coordinates={0,10}
It is often desirable to generate a ML representation of a document stored in the coordinate format. This coordinate-to-ML translation is difficult because: (i) the ML format depends upon a particular sequence of ML statements, whereas coordinate statements can be recorded in any order; and (ii) the ML format includes layout statements that explicitly define the layout of objects, whereas the coordinate format does not explicitly define layout (instead, layout is implied based on the coordinates of the objects).
Thus, what is required is a system and method for translating a coordinate based document to a ML based document.